1. Field of the Invention
The present invention relates to the field of computers. More specifically, the present invention relates to optimization.
2. Description of the Related Art
Executable files may include external object references to be linked at runtime. Some files or objects that are linked at runtime instead of during compile time include dynamically linked libraries, shared objects, and relocatable modules. The runtime linked objects are maintained separately from executable files that reference the runtime linked objects. A runtime linker/loader, embodied within an executable file or operating environment, finds runtime linked objects that are referenced in the executable file and loads the objects into execution space.
A link-editor can provide facilities for keeping segments that include external object references read-only. Keeping these segments as read-only causes each cross-module call or external data reference to be done through an extra redirection, such as a table, followed by a loading of the object's address. Keeping code segments as read-only code segments and calling external objects with redirection (or indirection) introduces application runtime overhead for external object function calls and external data references. Instead of calling external objects with redirection, the reference to the external object may be resolved directly (“relocation processing”). However, relocation processing introduces runtime linking overhead that may outweigh the redirection overhead. Accordingly, a technique is desired that intelligently processes external object references of a code unit to be resolved either directly or indirectly.